package com.xmtlxx.oms.mapper;

import com.xmtlxx.oms.domain.Classify;
import com.xmtlxx.oms.domain.bo.ClassifyBo;
import com.xmtlxx.oms.domain.vo.ClassifyVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 财物分类Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-12
 */
public interface ClassifyMapper extends BaseMapperPlus<ClassifyMapper, Classify, ClassifyVo> {
    /**
     * 根据条件分页查询财物分类
     *
     * @param classify 财物分类
     * @return Page Classify
     */
    @DataPermission({
//        @DataColumn(key = "tenantName", value = "c.create_by"),
//        @DataColumn(key = "deptName", value = "c.dept_id"),
//        @DataColumn(key = "userName", value = "c.create_by")
    })
    Page<ClassifyVo> selectPageClassifyList(@Param("page") Page<Classify> page,@Param("classify") ClassifyBo classify);

    /**
     * 查询财物分类列表
     *
     * @param classify 财物分类
     * @return 财物分类集合
     */
    @DataPermission({
//        @DataColumn(key = "tenantName", value = "c.create_by"),
//        @DataColumn(key = "deptName", value = "c.dept_id"),
//        @DataColumn(key = "userName", value = "c.create_by")
    })
    List<ClassifyVo> selectClassifyList(@Param("classify") ClassifyBo classify);

    ClassifyVo selectClassifyVoByID(String id);

    /**
     * 修改子元素关系
     *
     * @param classifys 子元素
     * @return 结果
     */
    int updateClassifyChildren(@Param("classifys") List<Classify> classifys);

}
